package com.gitee.wsl.time.timer

import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import kotlin.test.Test

class TimerTest {

    @Test
    fun testYTimer(){
        var count=10
        val timer=Timer().apply {
            this.subscribe {
                println("-time:$it")
                count--
                if(count==0)
                    stop()
            }
        }.finish {
            println("finish:$count")
        }
        runBlocking {
            timer.start()
            delay(100)

        }
    }

}